import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

export enum RewardType {
    TowShoot,
    Bomb
}
@ccclass('Reward')
export class Reward extends Component {
    @property
    rewardType: RewardType = RewardType.TowShoot;
    @property
    speed:number = 90;
    start() {

    }

    update(deltaTime: number) {
        const position = this.node.position;
        this.node.setPosition(position.x, position.y - this.speed * deltaTime, position.z);
        if(this.node.getPosition().y < -580){
            this.node.destroy();
        }
    }
}


